Communication device and method for controlling communication device

ABSTRACT

When an instruction operation given by a user to start communication parameter setting is detected, an operation mode of a communication device is determined. According to the determined operation mode, it is determined whether to provide a communication parameter through another communication device operating in a base station mode, or provide a communication parameter directly by the communication device.

This application is a continuation application of U.S. patentapplication Ser. No. 12/778,901 filed May 12, 2010, which claimspriority from Japanese Patent Application No. 2009-118974 filed May 15,2009, which are hereby incorporated by reference herein in theirentirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a communication device capable ofoperating in both operation modes of a base station mode in which thedevice functions as a base station and a slave station mode in which thedevice functions as a slave station.

2. Description of the Related Art

In wireless communication represented by a wireless local area network(LAN) complying with IEEE 802.11 standard series, there are many settingitems, which have to be set before use. For example, the setting itemsinclude communication parameters necessary for performing wirelesscommunications such as an SSID as a network identifier, an encryptionmethod, an encryption key, an authentication method, and anauthentication key. Setting them by a user's manual input is verycumbersome.

In a non patent document(http://www.wi-fi.org/files/kc/20090123_Wi-Fi_Protected_Setup.pdf), aWi-Fi Protected Setup (hereinafter, “WPS”), which is an industrystandard of communication parameter automatic setting in aninfrastructure mode in which a station (a slave station) communicatesthrough an access point (a base station) is discussed. In currentlycommercially available products that support the WPS function, the basestation mainly manages the communication parameters and directlyprovides the communication parameters to the slave station that requestsacquisition of the communication parameters.

In the WPS, a device that manages and provides the communicationparameters is called a registrar, and a wireless terminal that requestsacquisition of the communication parameters and receives thecommunication parameters from the registrar is called an enrollee. Insome products, an external device connected to the base station like apersonal computer (PC) has a function of the registrar, and thecommunication parameters can be provided from the external device to theslave station that operates as the enrollee through the base station.

In Japanese Patent Application Laid-Open No. 2009-038579, a technique ofsetting the communication parameters in an ad-hoc mode in which theslave station directly communicates without involving the base stationhas been suggested. Specifically, a technique of receiving thecommunication parameters from another communication device and providesthe received communication parameters to another communication deviceagain has been discussed.

Further, in US Patent Publication No. 2007-0297347, an example, in whichone communication device has both a base station function and a slavestation function and the functions are switched to performcommunications, has been discussed.

It is assumed that a plurality of wireless communication devices, whichcan automatically switch between the base station function and the slavestation function, are present, and another device is participating asthe slave station in a wireless network formed by a certain one deviceas the base station. Here, a case in which communication parameterautomatic setting by the WPS is performed to newly bring a wirelesscommunication device into the wireless network, is considered.

In this case, a user needs to instruct the newly participating deviceand the wireless communication device, which serves as a communicationparameter providing device among a plurality of wireless communicationdevices already connected with the wireless network, to startcommunication parameter automatic setting.

In a typical wireless network, each wireless communication device hasany one of the base station function and the slave station function, anda device which operates as the providing device is the base station or adevice connected to the base station. Therefore, the user can recognizethe newly participating device as a communication parameter receivingapparatus and the base station as the communication parameter providingdevice, and give a communication parameter automatic setting startinstruction.

However, in the case in which a plurality of wireless communicationdevices connected to the wireless network can automatically switch thebase station function and the slave station function, the user can notrecognize which wireless communication device operates as the basestation. As a result, there may occur a problem in which it is difficultto simply recognize which device operates as the communication parameterproviding device, and therefore it is difficult to recognize a device,which is an automatic setting operation target.

SUMMARY OF THE INVENTION

The present invention is directed to a communication device and a methodof controlling a communication device capable of easily performingcommunication parameter setting even in the communication device thatcan operate in both operation modes of the base station mode offunctioning as the base station and the slave station mode offunctioning as the slave station.

According to an aspect of the present invention, a communication devicecapable of operating in both operation modes of a base station modefunctioning as a base station and a slave station mode functioning as aslave station includes a determination unit configured to determine anoperation mode of the communication device when an instruction operationby a user to start communication parameter setting is detected, and aproviding unit configured to provide a communication parameter to adevice at the other end that requests provision of a communicationparameter through a base station when the operation mode determined bythe determination unit is the slave station mode, and to provide acommunication parameter to the device at the other end directly by thecommunication device when it is determined that the operation modedetermined by the determination unit is the base station mode.

According to another aspect of the present invention, a method forcontrolling a communication device capable of operating in bothoperation modes of a base station mode functioning as a base station anda slave station mode functioning as a slave station includes determiningan operation mode of the communication device when an instructionoperation given by a user to start communication parameter setting isdetected, and providing, when the determined operation mode is the slavestation mode, a communication parameter to a device at the other end,which requests provision of a communication parameter through a basestation, and providing, when the determined operation mode is the basestation mode, a communication parameter to the device at the other enddirectly by the communication device.

Further features and aspects of the present invention will becomeapparent from the following detailed description of exemplaryembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate exemplary embodiments, features,and aspects of the invention and, together with the description, serveto explain the principles of the invention.

FIG. 1 illustrates a network configuration according to an exemplaryembodiment of the present invention.

FIG. 2 is a block diagram illustrating a configuration of a wirelesscommunication device.

FIG. 3 is a block diagram illustrating a software functional block of awireless communication device according to an exemplary embodiment ofthe present invention.

FIG. 4 is a flowchart illustrating communication parameter automaticsetting processing executed by a wireless communication device accordingto a first exemplary embodiment.

FIG. 5 is a flowchart illustrating processing when a wirelesscommunication device A receives a registration request message accordingto the first exemplary embodiment.

FIG. 6 is a flowchart illustrating registration determination processingexecuted by the wireless communication device A according to the firstexemplary embodiment.

FIG. 7 is a flowchart illustrating processing when the wirelesscommunication device A receives information of a newly participatingterminal according to the first exemplary embodiment.

FIG. 8 is a flowchart illustrating processing of determiningcommunication parameters to be provided through the wirelesscommunication device as a communication parameter providing deviceaccording to the first exemplary embodiment.

FIG. 9 illustrates a sequence when a communication parameter automaticsetting start instruction is executed in a wireless communication deviceC and a wireless communication device D according to the first exemplaryembodiment.

FIG. 10 illustrates a sequence when a communication parameter automaticsetting start instruction is executed in the wireless communicationdevice A and the wireless communication device D according to the firstexemplary embodiment.

FIG. 11 is a flowchart illustrating communication parameter automaticsetting processing executed by a wireless communication device accordingto a second exemplary embodiment.

FIG. 12 illustrates a sequence according to the second exemplaryembodiment.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.

FIG. 1 is a network configuration diagram according to an exemplaryembodiment of the present invention.

The network illustrated in FIG. 1 includes a wireless communicationdevice A 101, a wireless communication device B 102, and a wirelesscommunication device C 103. A wireless communication device D 104 is aterminal, which newly participates in the network.

In the present exemplary embodiment, it is assumed that the wirelesscommunication device A, the wireless communication device B, thewireless communication device C, and the wireless communication device Dhave a communication function of an IEEE 802.11 wireless LAN(hereinafter, referred to as simply “wireless LAN”), respectively.

Further, the wireless communication device A, the wireless communicationdevice B, the wireless communication device C, and the wirelesscommunication device D have both an access point (hereinafter, a basestation) function and a station (hereinafter, a slave station) functionin the wireless LAN, and can operate as the base station or the slavestation, respectively.

Hereinafter, the case of operating as the base station is called a basestation mode, and the case of operating as the slave station is called aslave station mode. The wireless communication device A is operating inthe base station mode and forms (constructs) a wireless network 100. Thewireless communication device B and the wireless communication device Care operating in the slave station mode, respectively, and areparticipating in the wireless network 100. The operation mode of thewireless communication device D is not determined yet.

The wireless communication device A, the wireless communication deviceB, the wireless communication device C, and the wireless communicationdevice D have a communication parameter automatic setting function, andcan perform the WPS. In the present exemplary embodiment, it is assumedthat each wireless communication device has both a communicationparameter providing function and a communication parameter receivingfunction.

In other words, each communication device can operate as both theregistrar and the enrollee of the WPS. In the following description, itis assumed that the wireless communication device performs an operationas the registrar of the WPS when it operates as the communicationparameter providing device, and performs an operation as the enrollee ofthe WPS when it operates as the communication parameter receivingdevice.

FIG. 2 is a block diagram illustrating an example of a configuration ofeach wireless communication device.

The whole wireless communication device A 101 includes the followingunits. A control unit 201 controls the whole wireless communicationdevice by executing a control program stored in a storage unit 202. Thestorage unit 202 stores the control program executed by the control unit201 and various pieces of information such as the communicationparameters. Various operations, which will be described below, areperformed by the control unit 201 by executing the control programstored in the storage unit 202.

A wireless communication processing unit 203 performs wirelesscommunications. An antenna 204 is connected to an antenna control unit205. A display unit 206 performs various display functions such as afunction of outputting visibly recognizable information like a liquidcrystal display (LCD) or a light emitting diode (LED) or outputting asound like a speaker.

The operation unit 207 includes a setting button for generating atrigger for starting communication parameter automatic setting and anoperation button for performing entry of various pieces of information.The control unit 201 detects an operation of the setting button by anoperation of the operation unit 207 by the user and starts acommunication parameter setting operation, which will be describedbelow. A power unit 208 supplies electrical power to the wirelesscommunication device.

FIG. 3 is a block diagram illustrating an example of a configuration ofa software functional block executed by each wireless communicationdevice.

A software functional block 301 of the wireless communication deviceincludes the following units. A packet transmission unit 302 functionsto transmit packets related to various communications. A packetreception unit 303 functions to receive packets related to variouscommunications.

A registration determination unit 304 performs registrationdetermination when the wireless communication device that is operatingin the base station mode receives a registration request message forrequesting registration as the communication parameter providing devicefrom another wireless communication device. The registration requestmessage is a message for confirming whether the wireless communicationdevice can be operated as the communication parameter providing device.A registration request message generation unit 305 generates theregistration request message, which the wireless communication devicethat is operating in the slave station mode transmits to the wirelesscommunication device that is operating in the base station mode.

A slave station mode operation unit 306 performs control for operatingthe wireless communication device in the slave station mode. A basestation mode operation unit 307 performs control for operating thewireless communication device in the base station mode. A mode controlunit 308 performs operation mode determination processing and modeswitching control of the base station mode operation unit 307 and theslave station mode operation unit 306.

In the present exemplary embodiment, a communication parameter automaticsetting functional block 309 performs automatic setting of thecommunication parameters necessary for performing wirelesscommunications such as an SSID as a network identifier, an encryptionmethod, an encryption key, an authentication method, and anauthentication key. In the communication parameter automatic settingfunctional block 309, a communication parameter providing unit 310provides the communication parameters to the device at the other endwhen the wireless communication device functions as the communicationparameter providing device.

A communication parameter reception unit 311 receives the communicationparameters transmitted from the communication parameter providing devicewhen the wireless communication device functions as the communicationparameter receiving device. A communication parameter protocolprocessing unit 312 processes various protocols for communicationparameter automatic setting. A communication parameter automatic settingcontrol unit 313 perform control as to whether to operate as thecommunication parameter providing device or the communication parameterreceiving device, and starts or stops the communication parameterproviding unit 310 and the communication parameter reception unit 311.

A communication parameter management unit 314 manages the communicationparameter that is stored in the wireless communication device or newlygenerated. The communication parameter management unit 314 also performsmanagement as to which communication parameter is to be provided. Aterminal information management unit 315 manages terminal informationrelated to the wireless communication device that is participating inthe network constructed by the wireless communication device when thewireless communication device is operating in the base station mode.

The terminal information includes, for example, device information (adevice type, a device name, a serial number, and a model number) and aMAC address. A notification processing unit 316 performs processing ofnotifying the user or the wireless communication device at the other endof an error, which occurs at the time of communication parameter settingprocessing.

All functional blocks have a software or hardware correlation with eachother. The functional blocks described are one example, and a pluralityof functional blocks may configure one functional block, or a certainfunctional block may be divided into blocks for performing a pluralityof functions.

Processing when the wireless communication device D participates in thewireless network 100 according to the present exemplary embodiment willbe described with reference to FIGS. 4 to 10.

FIG. 4 is a flowchart of processing executed by each wirelesscommunication device according to the present exemplary embodiment.

When an operation of the setting button by the user to instruct a startof communication parameter automatic setting is detected (YES in stepS401), in step S402 and step S409, the wireless communication devicedetermines its own operation mode at that point of time. When it isdetermined that the operation mode is not determined yet (NO in stepS402 and NO in step S409), the processing proceeds to step S419, andoperation mode determination processing is performed therein.

In the operation mode determination processing, for example, it isdetermined whether any other wireless communication device that isoperating in the base station mode is present around. For example, amethod of determining that the device itself operates in the slavestation mode when any other wireless communication device that isoperating in the base station mode is detected, and determining that thedevice itself operates in the base station mode when any other wirelesscommunication device that is operating in the base station mode is notdetected, may be used.

When it is determined that the device itself operates in the basestation mode (YES in step S402), the processing proceeds to step S403and subsequent steps. However, when it is determined that the deviceitself operates in the slave station mode (YES in step S409), theprocessing is determined depending on whether the o device itself isconnected to the wireless network. When it is determined that the deviceitself is connected with the wireless network (YES in step S410), theprocessing proceeds to S411 and subsequent steps. However, when it isdetermined that the device itself is not connected with the wirelessnetwork (NO in step S410), the processing proceeds to step S420 andsubsequent steps.

In other words, in the network configuration of FIG. 1, when the settingbuttons of the respective wireless communication devices are operated,the wireless communication device A performs processing of step S403 andsubsequent steps, the wireless communication devices B and C performprocessing of step S411 and subsequent steps, and the wirelesscommunication device D performs processing of step S420 and subsequentsteps.

First, processing when a communication parameter automatic setting startinstruction is given in the wireless communication device C and thewireless communication device D will be described with reference to asequence diagram of FIG. 9. FIG. 9 is a sequence diagram when acommunication parameter automatic setting start instruction is given inthe wireless communication device C and the wireless communicationdevice D.

When the communication parameter automatic setting start instruction isexecuted in the wireless communication device D (YES in step S401), theprocessing proceeds to step S402. In step S402, it is determined whetherthe wireless communication device D is operating in the base stationmode. Since the operation mode of the wireless communication device D isnot determined yet (NO in step S402), the processing proceeds to stepS409. In step S409, it is determined whether the wireless communicationdevice D is operating in the slave station mode.

Similarly, since the operation mode is not determined yet (NO in stepS409), the processing proceeds to step S419. In step S419, a modedetermination processing of the operation mode is performed. Details ofthe mode determination processing are not described in the presentexemplary embodiment. In the present exemplary embodiment, it is assumedthat the wireless communication device D operates in the slave stationmode as the slave station that participates in the network.

In step S402 and step S409, operation mode determination is performedagain. Since the operation mode of the wireless communication device Dis the slave station mode (YES in step S409), the processing proceeds tostep S410. In step S410, it is determined whether the wirelesscommunication device D is connected with the wireless network.

Since the wireless communication device D is not connected with thewireless network yet (NO in step S410), the processing proceeds to stepS420. In step S420, to operate as the receiving device that receives thecommunication parameter, the communication parameter reception unit isstarted. The processing proceeds to step S421. In step S421, thewireless communication device D performs the communication parameterautomatic setting processing as the communication parameter receivingdevice.

The wireless communication device D, which has started the communicationparameter automatic setting processing, first transmits a retrievalrequest (M902) for retrieving the wireless communication device at theother end, which can perform communication parameter automatic setting.Specifically, the wireless communication device D transmits theretrieval request (a probe request) in which information representingthat communication parameter automatic setting is being performed isincluded and waits for reception of a retrieval response (a proberesponse) in which information representing that communication parameterautomatic setting is being performed is included for a predeterminedtime.

Similarly, when the communication parameter automatic setting startinstruction is given in the wireless communication device C (YES in stepS401), the processing proceeds to step S402. In step S402, it isdetermined whether the wireless communication device C is operating inthe base station mode. Since the wireless communication device C isoperating in the slave station mode (NO in step S402), the processingproceeds to step S409. In step S409, it is determined that the wirelesscommunication device C is operating in the slave station mode (YES instep S409), and the processing proceeds to step S410. In step S410, itis determined that the wireless communication device C is connected withthe wireless network 100 (YES in step S410), the processing proceeds tostep S411.

In step S411, it is determined whether the wireless communication deviceC is connected with the base station. Since the wireless communicationdevice C is connected with the wireless communication device A, which isoperating in the base station mode, it is determined that the wirelesscommunication device C is connected with the base station (YES in stepS411), and the processing proceeds to step S412. On the other hand, whenthe wireless communication device C is not connected with the basestation (NO in step S411), in the communication parameter automaticsetting processing according to the present exemplary embodiment, it isdetermined to be inoperable, and the processing proceeds to step S408.In step S408, error processing is performed.

The case in which the wireless communication device is connected withthe wireless network 100 but not connected with the base stationrepresents the case in which direct communication between the slavestations is being performed in the ad-hoc mode. In the present exemplaryembodiment, this case is described as error processing, but theoperation mode of the device itself may be changed to the base stationmode to start communication parameter automatic setting.

In step S411, processing of determining whether the connected basestation supports communication parameter automatic setting may be added.In this case, only when the base station supports communicationparameter automatic setting, the processing proceeds to step S412, andwhen the base station does not support communication parameter automaticsetting, the error processing in step S408 is performed.

In step S412, it is determined whether the wireless communication deviceC has been registered to the connected base station as the communicationparameter providing device. At this time, since the wirelesscommunication device C is not registered to the wireless communicationdevice A yet as the communication parameter providing device (NO in stepS412), the processing proceeds to step S413. On the other hand, whenalready registered (YES in step S412), the processing proceeds to stepS416.

In step S413, the wireless communication device C transmits aregistration request message (M901) to the wireless communication deviceA to confirm whether the wireless communication device C can beregistered to the base station as the communication parameter providingdevice.

The processing flow when the wireless communication device (the wirelesscommunication device A in the present exemplary embodiment) that isoperating in the base station mode receives the registration requestmessage from another wireless communication device (the wirelesscommunication device C in the present exemplary embodiment) that isoperating in the slave station mode will be described with reference toFIG. 5.

When the registration request message (M901) is received (YES in stepS501), in step S502, the wireless communication device A performsregistration determination processing as to whether the wirelesscommunication device C as a transmission source can be registered as thecommunication parameter providing device.

An example of the registration determination processing is illustratedin FIG. 6. In step S601, it is determined whether the wirelesscommunication device A (the base station mode) is already operating asthe communication parameter providing device. When the communicationparameter setting start instruction is already given in the wirelesscommunication device A and the wireless communication device A isoperating as the communication parameter providing device (YES in stepS601), the processing proceeds to step S602. On the other hand, when thewireless communication device A is not operating as the communicationparameter providing device (NO in step S601), the processing proceeds tostep S603.

In step S603, it is determined whether another wireless communicationdevice (for example, the wireless communication device B) is alreadyoperating as the communication parameter providing device. When anotherwireless communication device is already operating as the communicationparameter providing device (YES in step S603), the processing proceedsto step S602. On the other hand, when another wireless communicationdevice is not operating as the communication parameter providing deviceyet (NO in step S603), the processing proceeds to step S604.

In step S602, the wireless communication device C is inhibited fromoperating as the communication parameter providing device. In otherwords, it is determined that the wireless communication device C cannotbe registered as the communication parameter providing device. In stepS604, since there is no device that is operating as the communicationparameter providing device yet, the wireless communication device C isallowed to operate as the communication parameter providing device. Inother words, it is determined that the wireless communication device Ccan be registered as the communication parameter providing device.

As described above, by performing the processing of FIG. 6, it ispossible to limit the wireless communication device that operates as thecommunication parameter providing device on the network to one device.

The wireless communication device A releases the operation inhibition ofstep S602 at the following three timings. A first one is the case inwhich the device itself (the wireless communication device A in thepresent exemplary embodiment) completes processing as the communicationparameter providing device, a second one is the case in which anotherwireless communication device (the wireless communication device B inthe present exemplary embodiment) completes processing as thecommunication parameter providing device, and a third one is the case inwhich the wireless communication device as a request source (thewireless communication device C in the present exemplary embodiment)completes processing as the communication parameter providing device.

In the present exemplary embodiment, an example of the registrationdetermination processing has been described, but the registrationdetermination processing is not limited thereto. For example,determination may be performed by using the number of terminals that isparticipating in the wireless network. A maximum number of terminalsthat can participate in the wireless network is previously determined.When the number of participating terminals has already reached themaximum number of terminals, an operation as the communication parameterproviding device is not allowed, and it is determined that registrationis impossible. Therefore, it is possible to limit the number of wirelesscommunication devices that can participate in the network.

Further, a display for urging the user to select whether to allowregistration may be performed on the display unit 206 of the wirelesscommunication device A, and it may be determined by the user's operationon the operation unit 207 whether to register the wireless communicationdevice C as the communication parameter providing device. Theregistration determination processing is not limited thereto, and it isonly necessary to determine whether to allow registration as thecommunication parameter providing device.

Returning back to the description of FIG. 5, in step S503, when it isdetermined in the registration determination processing of step S502that registration is possible (YES in step S503), the processingproceeds to step S504. On the other hand, when registration isimpossible (NO in step S503), the processing proceeds to step S505.

In step S504, a registration response message (M903) representing thatregistration is possible is transmitted. In step S505, a registrationresponse message (M903) representing that registration is impossible istransmitted. In the present exemplary embodiment, it is assumed that itis determined that the wireless communication device C can be registeredas the communication parameter providing device.

Returning back to the description of FIG. 4, in step S414, the wirelesscommunication device C confirms a content of the received registrationresponse message (M903). When the registration response messagerepresenting that registration is possible is received (YES in stepS414), the processing proceeds to step S415. When the registrationresponse message representing that registration is impossible isreceived (NO in step S414), the processing proceeds to step S408, andthe error processing is performed. In the error processing, notificationrepresenting that the communication parameter automatic settingprocessing is impossible may be performed.

In step S415, the wireless communication device C starts thecommunication parameter providing unit 310 and performs registrationprocessing (M904) of registering to the wireless communication device Aas the communication parameter providing device. The registration may berealized by transmitting a subscribe message of the WPS. When theregistration processing is completed, the processing proceeds to stepS416. In step S416, the wireless communication device C performs thecommunication parameter automatic setting processing as thecommunication parameter providing device. In the communication parameterautomatic setting processing, the wireless communication device Cprovides the communication parameters to the wireless communicationdevice D through the wireless communication device A that is operatingin the base station mode.

First, the wireless communication device C transmits a startnotification message representing a start of the communication parameterautomatic setting processing to the wireless communication device A(M905). When the start notification message is received, the wirelesscommunication device A transmits the retrieval response (M906) includinginformation representing that communication parameter automatic settingis being performed in response to the communication parameter automaticsetting retrieval request (M902) transmitted from the wirelesscommunication device D. Even though not illustrated, before receivingthe start notification message from the wireless communication device C,the wireless communication device A transmits the retrieval responseincluding information representing that communication parameterautomatic setting is not being performed in response to the retrievalrequest (M902) from the wireless communication device D.

The wireless communication device D receives the retrieval responseincluding information representing that communication parameterautomatic setting is being performed, and detects the wirelesscommunication device A as the wireless communication device at the otherend of communication parameter automatic setting. After the detection,communication parameter automatic setting protocol processing (M907) isperformed, and the communication parameters are provided from thewireless communication device C to the wireless communication device Dthrough the wireless communication device A.

The communication parameter automatic setting protocol processing (M907)is performed by a registration protocol of the WPS. The wirelesscommunication device D is connected with the wireless network 100 byusing the provided communication parameters.

The processing flow of determining the communication parameters, whichare provided from the communication parameter providing device (thewireless communication device C in the present exemplary embodiment) tothe communication parameter receiving device (the wireless communicationdevice D in the present exemplary embodiment), will be described withreference to FIG. 8.

First, in step S801, the wireless communication device that operates asthe communication parameter providing device determines whether it isalready connected with the wireless network. The case in which thewireless communication device is already connected with the wirelessnetwork includes both the case in which the wireless communicationdevice forms the wireless network as the base station and the case inwhich the wireless communication device participates in the wirelessnetwork as the slave station.

When the wireless communication device is already connected with thewireless network (YES in step S801), the processing proceeds to stepS802. On the other hand, when the wireless communication device is notconnected with the wireless network yet (NO in step S801), theprocessing proceeds to step S803. In step S802, the communicationparameters of the connected wireless network are determined as thecommunication parameters to be provided. In step S803, newly generatedcommunication parameters or previously stored communication parametersare determined as the communication parameters to be provided.

Here, the communication parameters to be provided are the communicationparameters of the wireless network when the wireless communicationdevice newly constructs the wireless network as the base station. In thecase of the present exemplary embodiment, since the wirelesscommunication device C is already connected with the wireless network100, in step S802, the communication parameters of the wireless network100 are determined as the communication parameters to be provided.

Here, during the communication parameter automatic setting protocolprocessing (M907), the wireless communication device C can acquireterminal information related to the wireless communication device D,which is a communication parameter providing destination. The terminalinformation includes, for example, device information (a device type, adevice name, a serial number, and a model number), and a MAC address.

Returning back to the description of FIG. 4, when the wirelesscommunication device C completes the communication parameter automaticsetting processing, the processing proceeds to step S417. In step S417,device information and a MAC address of the wireless communicationdevice D are transmitted to the wireless communication device A as theterminal information of the wireless communication device, which newlyparticipates in the network (M908).

The processing flow when the wireless communication device A that isoperating in the base station mode receives the terminal information ofthe wireless communication device (the wireless communication device Din the present exemplary embodiment) which newly participates in thenetwork from another wireless communication device (the wirelesscommunication device C in the present exemplary embodiment) will bedescribed with reference to FIG. 7.

When the terminal information of the wireless communication device,which newly participates in the network, is received (YES in step S701),in step S702, the wireless communication device A determines whether thetransmission source is the registered communication parameter providingdevice. When the transmission source is the registered communicationparameter providing device (YES in step S702), the processing proceedsto step S703. In step S703, the terminal information of the wirelesscommunication device, which is participating in the wireless network 100managed by the device itself, is updated.

When the transmission source of the terminal information is theunregistered communication parameter providing device (NO in step S702),the received terminal information is discarded, and the processing isfinished. As described above, when the wireless communication device hasprovided the communication parameters as the communication parameterproviding device, even though participating in the wireless network asthe slave station, the wireless communication device transmits theterminal information of the newly participating device, which is thecommunication parameter providing destination, to the base station atonce. Since the base station updates the terminal information managed byitself based on the terminal information transmitted from the slavestation, it is possible to manage information of the wirelesscommunication device that is participating in the wireless network inreal time.

Returning back to the description of FIG. 4, when the wirelesscommunication device C finishes transmission of the terminal informationof the wireless communication device D, which newly participates in thenetwork, the processing proceeds to step S418, and deregistrationprocessing (M909) of deregistering as the communication parameterproviding device is performed. Specifically, a deregistration requestmessage of deregistering as the communication parameter providing deviceis transmitted to the wireless communication device A, which isoperating as the base station.

Next, processing when the communication parameter automatic settingstart instruction is given in the wireless communication device A andthe wireless communication device D will be described with reference toFIG. 10. FIG. 10 illustrates a sequence when the communication parameterautomatic setting start instruction is given in the wirelesscommunication device A and the wireless communication device D.Processing in the wireless communication device D is the same as theprocessing described above, and thus description thereof will not berepeated.

When the communication parameter automatic setting start instruction isgiven in the wireless communication device A (YES in step S401), theprocessing proceeds to step S402. In step S402, it is determined whetherthe wireless communication device A is operating in the base stationmode. Since the wireless communication device A is operating in the basestation mode (YES in step S402), the processing proceeds to step S403.In step S403, determination processing as to whether the device A can bestarted as the communication parameter providing device is performed.

In the determination processing, for example, it is confirmed whether adevice, other than the device A, that is operating as the providingdevice is present. When there is no device that is operating as theproviding device, it is determined that the device A can be started asthe providing device. The determination processing is not limitedthereto. In the present exemplary embodiment, it is assumed that thewireless communication device A can be started as the communicationparameter providing device.

Next, when it is determined in step S404 that the communicationparameter providing unit 310 can be started (YES in step S404), theprocessing proceeds to step S405. On the other hand, when it isdetermined that the communication parameter providing unit 310 cannot bestarted (NO in step S404), the processing proceeds to step S408, and theerror processing is performed. In step S405, the communication parameterproviding unit 310 of the device A is started, and the processingproceeds to step S406. In step S406, the communication parameterautomatic setting processing in which the device A is set as thecommunication parameter providing device is performed.

The wireless communication device A that has started the communicationparameter automatic setting processing transmits a retrieval response(M1002) including information which representing that the communicationparameter automatic setting is being performed in response to acommunication parameter automatic setting retrieval request (M1001)transmitted from the wireless communication device D.

The wireless communication device D receives the retrieval responseincluding the information representing that communication parameterautomatic setting is being performed, and detects the wirelesscommunication device A as the wireless communication device at the otherend of communication parameter automatic setting. After the detection,communication parameter automatic setting protocol processing (M1003) isperformed, and the communication parameters are provided from thewireless communication device A to the wireless communication device D.

The communication parameter automatic setting protocol processing(M1003) is performed by the registration protocol of the WPS. Thewireless communication device D is connected with the wireless network100 by using the provided communication parameters.

The communication parameters to be provided are determined by theprocessing flow of FIG. 8. Since the wireless communication device A isconstructing the wireless network 100 as the base station, in step S801,it is determined that the wireless communication device A is connectedwith the wireless network (YES in step S801). In step S802, thecommunication parameters of the wireless network 100 are determined asthe communication parameters to be provided. When the wirelesscommunication device A completes the communication parameter automaticsetting processing, the processing proceeds to step S407.

In step S407, the terminal information of the wireless communicationdevice, which is participating in the wireless network 100 managed bythe wireless communication device A, is updated by using the terminalinformation of the wireless communication device D acquired through thecommunication parameter automatic setting protocol processing.Therefore, the wireless communication device A can appropriately managethe wireless communication device that is participating in the wirelessnetwork 100.

As described above, in the present exemplary embodiment, the wirelesscommunication device that is connected with the wireless network 100determines the operation mode of the device itself in response to thecommunication parameter automatic setting start instruction. When thewireless communication device is operating as the slave station, thecommunication parameters are provided through another wirelesscommunication device that is operating as the base station. On the otherhand, when the wireless communication device is operating as the basestation, the wireless communication device directly provides thecommunication parameters.

As described above, according to the present exemplary embodiment, eventhough the user is not conscious of which wireless communication devicein the wireless network is the communication parameter providing device,it is possible to perform the communication parameter automatic settingprocessing. In other words, the communication parameter automaticsetting processing can be performed by executing the communicationparameter start instruction in the wireless communication device, whichnewly participates in the network, and a certain wireless communicationdevice within the wireless network. Therefore, the user's conveniencecan be improved.

In the above description, the wireless communication device D canoperate as both the base station and the slave station, but the presentinvention can be applied to the case in which the wireless communicationdevice D can operate as only the slave station. Further, in the abovedescription, the wireless communication device D has both the providingfunction and the receiving function of the communication parameterautomatic setting processing, but the present invention can be appliedto the case in which the wireless communication device D has only thereceiving function.

Further, in the above description, the wireless communication device Ctransmits the registration request message (M901) to the wirelesscommunication device A, and performs the registration processing (M904)after receiving the response message (M903) representing thatregistration is possible. However, these pieces of processing may beperformed together. In other words, when the registration requestmessage (M901) is received from the wireless communication device C, thewireless communication device A may register the wireless communicationdevice C as the communication parameter providing device.

It has been described above that the communication parameter automaticsetting processing start notification message (M905) is transmittedafter registration of the providing device. However, these pieces ofprocessing may be performed together. More specifically, when theregistration request message (M901) is received or when the registrationprocessing (M904) is completed, the wireless communication device A maydetermine that the wireless communication device C has started thecommunication parameter automatic setting processing, and thus transmitthe retrieval response of M906.

Further, it has been described above that the wireless communicationdevice D that has started the communication parameter automatic settingprocessing retrieves the other end of communication parameter automaticsetting by transmitting the retrieval request (M902 and M1001) andwaiting for reception of the retrieval response (M906 and M1002) (anactive scan). However, the method of retrieving the other end ofcommunication parameter automatic setting is not limited thereto. Forexample, a method of waiting for reception of a beacon transmitted fromthe wireless communication device A that operates as the base stationmay be used (a passive scan).

When the start notification message (M905) is received from the wirelesscommunication device C or when the setting start instruction operationis performed in the wireless communication device A, the wirelesscommunication device A starts transmission of the beacon includinginformation representing that the communication parameter automaticsetting is being performed. Therefore, the wireless communication deviceD can detect the wireless communication device A as the other end ofcommunication parameter automatic setting by waiting for reception ofthe beacon. Further, the retrieval in which the active scan and thepassive scan are combined may be used.

In the first exemplary embodiment, the case in which the registrationprocessing as the communication parameter providing device is performedafter the communication parameter automatic setting start is instructed,has been described.

In a second exemplary embodiment, the case of performing theregistration processing to the base station in advance is described. Thenetwork configuration (FIG. 1) and the configuration of each wirelesscommunication device (FIGS. 2 and 3) are the same as in the firstexemplary embodiment, and description thereof will not be repeated.

In the present exemplary embodiment, processing of until the wirelesscommunication device D participates in the wireless network 100 afterthe communication parameter automatic setting processing is performed inthe wireless communication device A and the wireless communicationdevice C to form the wireless network 100, is described.

First, the wireless communication device A operates in the base stationmode and constructs the wireless network 100, and the wirelesscommunication device C performs communication parameter automaticsetting in the slave station mode, and is connected with the wirelessnetwork 100. Next, the wireless communication device D attempts to beconnected with the wireless network 100. At this time, it is assumedthat the communication parameter automatic setting start instruction isgiven in the wireless communication device C and the wirelesscommunication device D.

The series of processing is described with reference to FIGS. 5 to 8,and FIGS. 11 and 12.

FIG. 11 is a flowchart of each wireless communication device accordingto the present exemplary embodiment. The same processing as the flow ofFIG. 4 is denoted by the same reference numeral. When FIG. 11 iscompared to FIG. 4, the processing of step S412 to step S415 and stepS418 is deleted, and processing of step S1101 to step S1103 is addedsubsequent to the processing of step S421.

FIG. 12 is a sequence diagram illustrating processing of untilcommunication parameter setting is performed between the wirelesscommunication device C and the wireless communication device D aftercommunication parameter setting is performed in the wirelesscommunication device A and the wireless communication device C.

First, the communication parameter automatic setting start instructionis given in the wireless communication device A and the wirelesscommunication device C. When the communication parameter automaticsetting start instruction is given, since the operation modes of thewireless communication devices A and C are not determined yet, the bothdevices perform the processing of step S401 step S402 step S409 stepS419. In the present exemplary embodiment, for simplification ofdescription, it is assumed that in the operation mode determinationprocessing of step S419, the operation mode of the wirelesscommunication device A is determined as the base station mode, and theoperation mode of the wireless communication device C is determined asthe slave station mode.

Since the operation mode of the wireless communication device A isdetermined as the base station mode, the processing proceeds to stepS419→step S402→step S403→ . . . → step S407. Since processing subsequentto step S403 is the same as the processing of the wireless communicationdevice A described in the first exemplary embodiment, descriptionthereof will not be repeated.

Since the operation mode of the wireless communication device C isdetermined as the slave station mode, the processing proceeds to stepS419→step S402→step S409→step S410. Since the wireless communicationdevice C is not connected with the wireless network, the processingproceeds to step S420. In step S420, to operate as the receiving devicethat receives the communication parameters, the communication parameterreception unit 311 is started, and the processing proceeds to step S421.In step S421, the communication parameter automatic setting processingis performed.

The wireless communication device C that has started the communicationparameter automatic setting processing first transmits a retrievalrequest (M1201) for retrieving the wireless communication device at theother end in which communication parameter automatic setting ispossible. Specifically, the retrieval request (a probe request)including information representing that communication parameterautomatic setting is being performed, is transmitted. The wirelesscommunication device C waits for reception of a retrieval response (aprobe response) including information representing that thecommunication parameter automatic setting is being performed for apredetermined time.

When the retrieval response (M1202) including information representingthat the communication parameter automatic setting is being performed istransmitted from the wireless communication device A that has startedthe communication parameter automatic setting processing in step S406,the wireless communication device C detects the wireless communicationdevice A as the other end of the communication parameter automaticsetting. The wireless communication device C performs communicationparameter automatic setting protocol processing (M1203) with thewireless communication device A, and receives the communicationparameters of the wireless network 100 from the wireless communicationdevice A, which is the providing device.

When the communication parameter automatic setting protocol processing(M1203) is completed, the wireless communication device C is connectedwith the wireless network 100. After connection with the wirelessnetwork 100, the wireless communication device C performs registrationprocessing of registering itself to the wireless communication device Aas the communication parameter providing device in step S1101 to stepS1103. The flow of the registration processing is the same as step S413to step S415 of FIG. 4 described in the first exemplary embodiment.

In step S1101, the wireless communication device C transmits aregistration request message (M1204) to the wireless communicationdevice A. After receiving the registration request message (M1204), thewireless communication device A performs the processing of FIG. 5, andtransmits a registration response message (M1205) to the wirelesscommunication device C. In the present exemplary embodiment, in theregistration determination processing of step S502, the processing ofFIG. 6 is not performed.

That is, even though a device, other than the wireless communicationdevice C, that functions as the providing device is present, thewireless communication device A transmits the registration responsemessage (M1205) representing that registration as the providing deviceis possible.

In step S1102, the wireless communication device C confirms a content ofthe received registration response message (M1205). Since registrationis possible (YES in step S1102), the processing proceeds to step S1103.In step S1103, the wireless communication device C starts thecommunication parameter providing unit 310 and performs registrationprocessing (M1206) to the wireless communication device A as thecommunication parameter providing device.

As described above, in the present exemplary embodiment, the wirelesscommunication device C participates in the wireless network 100 and thenperforms registration processing of registering as the communicationparameter providing device to the wireless communication device A, whichoperates as the base station, in advance.

Thereafter, in order for the wireless communication device D toparticipate in the wireless network 100, the communication parameterautomatic setting start instruction is given in the wirelesscommunication device C and the wireless communication device D.

The processing flow of the wireless communication device D is the sameas the processing flow of the wireless communication device C, and thusdescription thereof will not be repeated.

Since the wireless communication device C is operating in the slavestation mode, the processing proceeds to step S401→step S402→stepS409→step S410. Since the wireless communication device C is connectedwith the wireless network, the processing proceeds to step S411.Further, since the wireless communication device C is connected with thewireless communication device A that is operating in the base stationmode, the processing proceeds to step S416. In step S416, thecommunication parameter automatic setting processing is performed.

First, the wireless communication device C transmits a startnotification message representing a start of the communication parameterautomatic setting processing to the wireless communication device A(M1207). When the start notification message is received, the wirelesscommunication device A transmits the retrieval response (M1209)including information representing that communication parameterautomatic setting is being performed in response to the communicationparameter automatic setting retrieval request (M1208) transmitted fromthe wireless communication device D.

The wireless communication device D receives the retrieval responseincluding information representing that communication parameterautomatic setting is being performed, and thus detects the wirelesscommunication device A as the wireless communication device at the otherend of communication parameter automatic setting. After the detection,communication parameter automatic setting protocol processing (M1210) isperformed, and the communication parameters are provided from thewireless communication device C to the wireless communication device Dthrough the wireless communication device A. The wireless communicationdevice D is connected with the wireless network 100 by using theprovided communication parameters.

Thereafter, in step S417, the wireless communication device C transmitsterminal information of the wireless communication device D that hasnewly participated in the wireless network 100 to the wirelesscommunication device A (M1211), and the wireless communication device Aupdates terminal information managed by itself. Even though notillustrated, the wireless communication device D participates in thewireless network 100, and then performs registration processing to thewireless communication device A as the communication parameter providingdevice.

Further, in the present exemplary embodiment, even after providing thecommunication parameters, the wireless communication device C does notperform processing (processing corresponding to that in step S418) ofderegistering as the providing device but continues registration as thecommunication parameter providing device. The deregistration isperformed at any given time, for example, when departing from thewireless network 100 or when the user or the wireless communicationdevice A requests the deregistration.

As described above, in the present exemplary embodiment, when thewireless communication device is connected with the wireless network,registration processing as the communication parameter providing deviceis performed in advance. As a result, when the communication parameterautomatic setting start instruction operation is performed,communication parameter automatic setting can be performed at once.Therefore, in addition to the effect of the first exemplary embodiment,it is possible to reduce time taken for communication parameter setting.

In the above description, the wireless communication device D canoperate as both the base station and the slave station, but the presentinvention can be applied to the case in which the wireless communicationdevice D can operate as only the slave station. Further, it has beendescribed that the wireless communication device D has both theproviding function and the receiving function of the communicationparameter automatic setting processing, but the present invention can beapplied to the case in which the wireless communication device D hasonly the receiving function. In this case, in the wireless communicationdevice D, the processing of step S1101 to step S1103 of FIG. 11 isomitted.

In the exemplary embodiments, a description of the wirelesscommunication device B is omitted, but in the case in which thecommunication parameter automatic setting start instruction is given inthe wireless communication device B, the same processing flow as thewireless communication device C is performed.

Further, in the exemplary embodiments, it has been described that thecommunication parameter automatic setting start instruction is given bythe operation of the setting button, that is, by the pushbuttonconfiguration (PBC) method of the WPS. However, the present invention isnot limited thereto, and the start instruction may be given by a methodof inputting a personal identification number (PIN) code and performingauthentication.

Further, a network identifier, an encryption method, an encryption key,an authentication method, and an authentication key have been describedas examples of the communication parameters. However, differentinformation may be used, and it is needless to say that differentinformation may be included in the communication parameter.

In the exemplary embodiments, the present invention has been describedby focusing on the case in which the wireless LAN complying with IEEE802.11 is applied thereto, but the present invention is not limitedthereto. For example, the present invention may employ another wirelesscommunication medium such as wireless USB, MBOA, Bluetooth (registeredtrademark), UWB, and ZigBee. Further, the present invention may beimplemented using a wired communication medium such as a wired LAN.

Here, MBOA stands for Multi Band OFDM Alliance. Further, UWB includeswireless USB, wireless 1394, and WINET.

Further, a recording medium in which a computer program of software forimplementing a function of the present exemplary embodiment is recordedmay be supplied to a system or a device, and a computer (a centralprocessing unit (CPU) or a micro processing unit (MPU)) of the system orthe device may read out and execute the program code stored in therecording medium. It is needless to say that the objects of the presentinvention can be achieved by this.

As described above, according to the present exemplary embodiments, eventhe communication device that can operate in both operation modes of abase station mode in which the communication device functions as a basestation and a slave station mode in which the communication devicefunctions as a slave station can easily perform communication parametersetting.

Aspects of the present invention can also be realized by a computer of asystem or apparatus (or devices such as a CPU or MPU) that reads out andexecutes a program recorded on a memory device to perform the functionsof the above-described exemplary embodiments, and by a method, the stepsof which are performed by a computer of a system or apparatus by, forexample, reading out and executing a program recorded on a memory deviceto perform the functions of the above-described exemplary embodiments.For this purpose, the program is provided to the computer for examplevia a network or from a recording medium of various types serving as thememory device (e.g., computer-readable medium). In such a case, thesystem or apparatus, and the recording medium where the program isstored, are included as being within the scope of the present invention.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the discussed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation toencompass all modifications, equivalent structures, and functions.

What is claimed is:
 1. A communication device comprising: adetermination unit configured to determine whether an operation mode ofthe communication device is a base station mode in which thecommunication device operates as a base station that creates a wirelessnetwork or a client station mode in which the communication deviceoperates as a client station that participates in the create wirelessnetwork; and a providing unit configured to provide a communicationparameter of a wireless network created by the communication device toanother communication device in the case that the determination unitdetermines that the operation mode of the communication device is thebase station mode, and to provide a communication parameter of thewireless network created by the base station to another communicationdevice in the case that the determination unit determines that theoperation mode of the communication device is the client station mode.2. The communication device according to claim 1, further comprising: areception unit configured to receive an instruction to start setting acommunication parameter from a user, wherein the determination unit isconfigured to determine an operation mode in which the communicationdevice is operating when the reception unit receives the instruction. 3.The communication device according to claim 1, further comprising: adecision unit configured to decide an operation mode of thecommunication device in the case that the operation mode is undecided.4. The communication device according to claim 3, wherein the decisionunit is configured to decide an operation mode by searching whetherthere is another communication device that is operating in the basestation mode or not.
 5. The communication device according to claim 4,wherein the decision unit is configured to decide that the communicationdevice is to operate in the client station mode in the case that thereis another communication device that is operating in the base stationmode.
 6. The communication device according to claim 4, wherein thedecision unit is configured to decide that the communication device isto operate in the base station mode in the case that there is no othercommunication device that is operating in the base station mode.
 7. Thecommunication device according to claim 1, wherein a communicationparameter provided by the providing unit is a parameter of a wirelessnetwork complying with IEEE 802.11.
 8. The communication deviceaccording to claim 1, wherein the communication parameter includes atleast one of a network identifier, an encryption method, an encryptionkey, an authentication method, and an authentication key.
 9. Acommunication device comprising: a determination unit configured todetermine whether an operation mode of the communication device is abasestation mode in which the communication device operates as a basestation that creates a wireless network or a client station mode inwhich the communication device operates as a client station thatparticipates in the created wireless network; and a providing unitconfigured to provide a first communication parameter to anothercommunication device in the case that the determination unit determinesthat the operation mode of the communication device is the base stationmode, and to provide a second communication parameter different from thefirst communication parameter to another communication device in thecase that the determination unit determines that the operation mode ofthe communication device is the client station mode.
 10. Thecommunication device according to claim 9, further comprising: areception unit configured to receive an instruction to start setting acommunication parameter from a user, wherein the determination unit isconfigured to determine an operation mode in which the communicationdevice is operating when the reception unit receives the instruction.11. The communication device according to claim 9, further comprising: adecision unit configured to decide an operation mode of thecommunication device in the case that the operation mode is undecided.12. The communication device according to claim 11, wherein the decisionunit is configured to decide an operation mode by searching whetherthere is another communication device that is operating in the basestation mode or not.
 13. The communication device according to claim 12,wherein the decision unit is configured to decide that the communicationdevice is to operate in the client station mode in the case that thereis another communication device that is operating in the base stationmode.
 14. The communication device according to claim 12, wherein thedecision unit is configured to decide that the communication device isto operate in the base station mode in the case that there is no othercommunication device that is operating in the base station mode.
 15. Thecommunication device according to claim 9, wherein a communicationparameter provided by the providing unit is a parameter of a wirelessnetwork complying with IEEE 802.11.
 16. The communication deviceaccording to claim 9, wherein the communication parameter includes atleast one of a network identifier, an encryption method, an encryptionkey, an authentication method, and an authentication key.
 17. Acommunication method comprising: determining whether an operation modeof a communication device is a base station mode in which thecommunication device operates as a base station that creates a wirelessnetwork or a client station mode in which the communication deviceoperates as a client station that participates in the created wirelessnetwork; and providing a communication parameter of a wireless networkcreated by the communication device to another communication device inthe case that it is determined that the operation mode of thecommunication device is the base station mode, and to provide acommunication parameter of the wireless network created by the basestation to another communication device in the case that it isdetermined that the operation mode of the communication device is theclient station mode.
 18. A storage medium storing a computer readableprogram for causing a computer to execute each process of thecommunication method according to claim
 17. 19. A communication methodcomprising: determining whether an operation mode of a communicationdevice is a base station mode in which the communication device operatesas a base station that creates a wireless network or a client stationmode in which the communication device operates as a client station thatparticipates in the created wireless network; and providing a firstcommunication parameter to another communication device in the case thatthe determination determines that the operation mode of thecommunication device is the base station mode, and to provide a secondcommunication parameter different from the first communication parameterto another communication device in the case that the determinationdetermines that the operation mode of the communication device is theclient station mode.
 20. A storage medium storing a computer readableprogram for causing a computer to execute each process of thecommunication method according to claim 19.